# $Id: PKGBUILD 65162 2012-02-20 05:27:23Z spupykin $
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor:  Gour <gour@mail.inet.hr>

pkgname=emms
pkgver=3.0
pkgrel=2
pkgdesc="The Emacs Multimedia System"
url="http://www.gnu.org/software/emms/"
arch=('any')
license=('GPL3')
depends=('emacs' )
install=${pkgname}.install
source=(http://www.gnu.org/software/$pkgname/download/$pkgname-$pkgver.tar.gz)
md5sums=('0ffb070394db0a8ca9152c66c72809c0')

build() {
  cd $srcdir/$pkgname-$pkgver
  sed -i -e "s|PREFIX=\$(DESTDIR)/usr/local|PREFIX=/usr|" Makefile
  sed -i -e "s|INFODIR=\$(PREFIX)/info|INFODIR=\$(DESTDIR)\$(PREFIX)/share/info|" Makefile
  sed -i -e "s|MAN1DIR=\$(PREFIX)|MAN1DIR=\$(DESTDIR)\$(PREFIX)|" Makefile
  sed -i -e "s|SITELISP=\$(PREFIX)|SITELISP=\$(DESTDIR)\$(PREFIX)|" Makefile
  sed -i -e "s|\(for p in \$(MAN1PAGES).*\)| mkdir -p \$(MAN1DIR); \1|" Makefile
  sed -i -e "s|\$(INSTALLINFO) emms.info||" Makefile
  make
  make DESTDIR=$pkgdir install
}
